<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>河南青少年机器人竞赛</title>
    		<link href="css/mui.min.css" rel="stylesheet"/>
    		<link href="css/style.css" rel="stylesheet"/>
		<style>
			.mui-badge-blue, .mui-badge-primary{
				width: 40px;}
			p{margin-bottom: 0;}
			.mui-table-view-cell.mui-collapse .mui-table-view{margin-top: 0;}
			.mui-navigate-right:after, .mui-push-left:after, .mui-push-right:after{color:#000}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a id="back" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">成绩</h1>
		</header>
		<div class="mui-content">
			<!--<div class="mui-card">-->
				<!--<div class="mui-card-header"> <div class="mui-media-body">郑州中学一队(初中组)<p>机器人挑战赛(A类)</p></div><span class="mui-badge mui-badge-primary">市赛</span></div>-->
				<!--<div class="mui-card-content">-->
					<!--<ul class="mui-table-view">-->
					<!--<li class="mui-table-view-cell mui-collapse mui-active">-->
						<!--<a class="mui-navigate-right mui-active" href="#">挑战赛成绩</a>-->
						<!--<div class="mui-collapse-content">-->
							<!--<ul class="mui-table-view">-->
							    <!--<li class="mui-table-view-cell coler-c">第一轮-->
							        <!--<span class="mui-pull-right">总分:85.00</span>-->
							    <!--</li>-->
							    <!--<li class="mui-table-view-cell coler-c">第二轮-->
							        <!--<span class="mui-pull-right">总分:185.00</span>-->
							    <!--</li>-->
							    <!--<li class="mui-table-view-cell coler-c">第三轮-->
							        <!--<span class="mui-pull-right">总分:95.00</span>-->
							    <!--</li>-->
							<!--</ul>-->
						<!--</div>-->
					<!--</li>-->
				<!--</ul>-->
				<!--</div>-->
				<!--<div class="mui-card-footer">总成绩：98</div>-->
			<!--</div>-->
		</div>
		<script src="js/mui.min.js"></script>
		<script src="js/jquery-1.9.1.min.js"></script>
		<script type="text/javascript">
			mui.ready(function(){
				mui.ajax('../team/front/',{
					data:"",
					dataType:'json',//服务器返回json格式数据
					type:'get',//HTTP请求类型
					//timeout:10000,//超时时间设置为10秒；
					headers:{'Content-Type':'application/json'},
					success:function(data){
						console.log(data)
						var result = data.data;
						var rel="";

						if(result!=null){
							mui.each(result,function(i,e) {
								rel += '<div class="mui-card">' +
										'<div class="mui-card-header"><div class="mui-media-body">' + e.teamName + '(初中组)<p>'+e.project.name+'</p></div><span class="mui-badge mui-badge-primary">'+(e.templateId = null?"市赛":"省赛")+'</span></div>';
								rel += '<div class="mui-card-content">' +
										'<ul class="mui-table-view">' +
										'<li class="mui-table-view-cell mui-collapse mui-active">' +
										'<a class="mui-navigate-right mui-active" href="#">成绩详情</a>' +
										'<div class="mui-collapse-content">';
								var count = 0;
								if (e.teamScores.length > 0) {
									rel += '<ul class="mui-table-view">';
									mui.each(e.teamScores, function (index, item) {
										rel += ' <li class="mui-table-view-cell coler-c"> 第' + item.lunCi + '轮' +
												'<span class="mui-pull-right">' + item.score + '</span>' +
												' </li>';
										count += item.score;
									});
									rel += '</ul>';
								}
								rel += '</div>' +
										'</li>' +
										'</ul>' +
										'</div>' +
										'<div class="mui-card-footer">总成绩：' + count + '</div>' +
										'</div>';
							});
							$('.mui-content').append(rel);
						}else{
							mui.toast("暂无数据",{ duration:'2000', type:'div' });
						}


					},
					error:function(xhr,type,errorThrown){
						//异常处理；
						console.log(xhr);
						console.log(type);
						console.log(errorThrown);
					}
				});
			});
			$("#back").click(function(){
				mui.openWindow({
					url:'index.html'
				});
			})
		</script>
	</body>
</html>
